import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Nyt7LandRightsVO, Nyt7LandRightsForm, Nyt7LandRightsQuery } from '@/api/Nyt7LandRights/Nyt7LandRights/types';

/**
 * 查询确权数据列表
 * @param query
 * @returns {*}
 */

export const listNyt7LandRights = (query?: Nyt7LandRightsQuery): AxiosPromise<Nyt7LandRightsVO[]> => {
  return request({
    url: '/Nyt7LandRights/Nyt7LandRights/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询确权数据详细
 * @param id
 */
export const getNyt7LandRights = (id: string | number): AxiosPromise<Nyt7LandRightsVO> => {
  return request({
    url: '/Nyt7LandRights/Nyt7LandRights/' + id,
    method: 'get'
  });
};

/**
 * 新增确权数据
 * @param data
 */
export const addNyt7LandRights = (data: Nyt7LandRightsForm) => {
  return request({
    url: '/Nyt7LandRights/Nyt7LandRights',
    method: 'post',
    data: data
  });
};

/**
 * 修改确权数据
 * @param data
 */
export const updateNyt7LandRights = (data: Nyt7LandRightsForm) => {
  return request({
    url: '/Nyt7LandRights/Nyt7LandRights',
    method: 'put',
    data: data
  });
};

/**
 * 删除确权数据
 * @param id
 */
export const delNyt7LandRights = (id: string | number | Array<string | number>) => {
  return request({
    url: '/Nyt7LandRights/Nyt7LandRights/' + id,
    method: 'delete'
  });
};
